package com.pgybook.front.action.vo;

import com.pgybook.front.service.GoeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IDEA.
 * User: feeling
 * Date: 13-11-22
 * Time: 上午12:33
 */
@Controller
@RequestMapping("goe")
public class GoeAct {

    @RequestMapping("province")
    @ResponseBody
    public Object getProvince() {
        return goeSrv.getProvinces();
    }


    @RequestMapping(value = "city/{province}.jspx", produces = "text/html;charset=UTF-8")
    @ResponseBody
    public Object getCities(@PathVariable Integer province) {
        return goeSrv.getCities(province);
    }

    @RequestMapping("cityDistrict/{city}.jspx")
    @ResponseBody
    public Object getCityDistricts(@PathVariable Integer city) {
        return goeSrv.getCityDistricts(city);
    }

    @Autowired
    GoeService goeSrv;
}
